package com.hnluchuan.bmjlearning.security;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;

public class MySecurityContextLogoutHandler extends SecurityContextLogoutHandler {

	@Override
	public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
		super.logout(request, response, authentication);
		try {
			response.sendRedirect("/admin/login");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
